package com.yanggu.elasticsearch.domain.doc;

import com.yanggu.elasticsearch.domain.entity.HotelEntity;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class HotelDoc {
    private Long id;
    private String name;
    private String address;
    private Integer price;
    private Integer score;
    private String brand;
    private String city;
    private String starName;
    private String business;
    private String location;
    private String pic;

    public HotelDoc(HotelEntity hotelEntity) {
        this.id = hotelEntity.getId();
        this.name = hotelEntity.getName();
        this.address = hotelEntity.getAddress();
        this.price = hotelEntity.getPrice();
        this.score = hotelEntity.getScore();
        this.brand = hotelEntity.getBrand();
        this.city = hotelEntity.getCity();
        this.starName = hotelEntity.getStarName();
        this.business = hotelEntity.getBusiness();
        this.location = hotelEntity.getLatitude() + "," + hotelEntity.getLongitude();
        this.pic = hotelEntity.getPic();
    }
}